<%@ page import="com.meila.cms.util.page.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager" %>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>



<pg:pager export="curPage=pageNumber" 
	items="${param.totalRecord }" 
	maxPageItems="<%=SystemContext.getPageSize() %>"
	url="${param.url }">

		<c:forEach items="${param.params}" var="p">
			<pg:param name="${p}"/>
		</c:forEach>
		
    <div class="clearfix" id="sample-table-2_paginate">
	
		<ul class="pagination" style="display: block;">
 
			<pg:first>
				<li>
					<a href="${pageUrl }">首页</a>
				</li>
				
				<script type="text/javascript" >
				 function topage(){
			 
			        var offset= ($('#number').val()-1)*<%=SystemContext.getPageSize() %>;
			        var url = '${pageUrl}';
			        url=url.substring(0, url.indexOf("?"));
			        
			        window.location.href=url+"?pager.offset="+offset;
			 
			     }
                 </script>
			</pg:first>
<%-- 			<pg:prev>
				<li>
					<a href="${pageUrl }">上一页</a>
				</li>
			</pg:prev> --%>
			<pg:pages>
				<c:if test="${curPage eq pageNumber }">
					<li class="active"><a>${pageNumber }</a></li>
				</c:if>
				<c:if test="${curPage != pageNumber }">
					<li><a href="${pageUrl }">${pageNumber }</a></li>
				</c:if>
			</pg:pages>
<%-- 			<pg:next>
				<li>
					<a href="${pageUrl }">下一页</a>
				</li>
			</pg:next> --%>
			<pg:last>
				<li>
					<a href="${pageUrl }">尾页</a>
				</li>
			</pg:last>
 
		</ul>
 
		 <div class="clearfix" style="float:right;margin-top: 5px">
			<pg:last><span>共<font color="red"> ${pageNumber}</font> 页,每页<font color="red"><%=SystemContext.getPageSize() %></font>条,<font color="red">${param.totalRecord }</font>条记录,</span> 到第 <input type="number" id="number"  onkeyup="value=''" max="${pageNumber}" min="1" value="${curPage}" class="console-countInput"/> 页</pg:last>
			<pg:last><span class="label label-primary" onclick="topage()">确定</span></pg:last>
		</div>
	  </pg:pager>
	</div>
 		


